home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: menu_test.java,v 1.11 1996/10/03 19:46:51 hudson Exp $
- * $Author: hudson $
- */
- package sub_arctic.test;
-
- import sub_arctic.lib.*;
- import sub_arctic.output.*;
- import sub_arctic.input.*;
- import sub_arctic.constraints.std_function;
-
- import java.awt.Font;
-
- public class menu_test extends interactor_applet implements callback_object {
- public void build_ui(base_parent_interactor top) {
- String[] os={"Windows 3.1","Lignux 2.0 Beta", "Solaris 2.5.1",
- "Windows NT 4.0"};
- String [] solaris_version = {"On Intel","On Sparc", "On Power PC"};
-
- menu_button mb;
- menu m1,m2;
- Font f=new Font("Helvetica",Font.PLAIN, 14);
- int max1=text_menu_item.max_item_width(os,f),
- max2=text_menu_item.max_item_width(solaris_version,f);
- pullright_menu_item pr;
- label l;
-
- m1=new menu();
- m2=new menu();
-
- /* first menu to build is second one displayed */
- m2.add_child(new text_menu_item(solaris_version[0],f,max2));
- m2.add_child(new text_menu_item(solaris_version[1],f,max2));
- m2.add_child(new text_menu_item(solaris_version[2],f,max2));
-
- /* make a label , just for kicks */
- l = new label("Operating Systems",max1,f);
- /* main menu */
- m1.add_child(l);
- m1.add_child(new text_menu_item(os[0],f,max1));
- m1.add_child(new text_menu_item(os[1],f,max1));
- pr=new pullright_menu_item(os[2],f,max1,m2);
- m1.add_child(pr);
- m1.add_child(new text_menu_item(os[3],f,max1));
-
- mb=new menu_button("Click Me!",f,m1);
- mb.set_x(10);
- mb.set_y(10);
-
- /* note that although the trees for the menus are built, they
- are NOT added to the toplevel parent... the menu buttons
- (and pullrights) need flexibility in doing parenting. Later
- they may NOT put them in the top_level parent, but create
- new AWT windows for them ...*/
- top.add_child(mb);
-
- }
- public void callback(interactor from_obj, event evt,int callback_num,
- Object callback_info) {
- System.out.println("Callback called!");
-
- }
-
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-